CC=g++
CFLAGS=-O2 -Wno-write-strings

BIN=../bin/
ULIB_DIR=/home/swlee/.lib/ulib_/
#ULIB_DIR=/Users/windnc/.lib/ulib_/

ULIB_INC=-I${ULIB_DIR}include
ULIB_OBJ=${ULIB_DIR}lib/ulib.a
OBJ=copycat.o copycat-train.o copycat-test.o util.o tree.o giza.o rule.o sent.o

all: ${OBJ}
	mkdir -p ${BIN}
	${CC} ${CFLAGS} copycat-main.cpp -o ${BIN}copycat ${OBJ} ${ULIB_OBJ} ${ULIB_INC}
	${CC} ${CFLAGS} copycat-train-main.cpp -o ${BIN}copycat-train ${OBJ} ${ULIB_OBJ} ${ULIB_INC}
#cd tool; make; cd ..

.cpp.o:
	${CC} ${CFLAGS} -c $< -o $*.o ${ULIB_INC}

clean:
	rm -rf *.o
	rm -rf ${BIN}copycat ${BIN}tree_conv ${BIN}cmp_line ${BIN}recov-re ${BIN}wa-inspector ${BIN}copycat-train
	cd tool; make clean; cd ..

co:
	svn co $$svn_ulib
	cd ulib; make; make install; cd ..

